//
//  SopViewCell.m
//  DigiOps
//
//  Created by app on 2018/7/18.
//  Copyright © 2018年 俞渊华. All rights reserved.
//

#import "ChangeShiftViewCell.h"

@implementation ChangeShiftViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
//    [self.sopInfo setBackgroundImage:[UIImage imageNamed:@"sop_info"] forState:UIControlStateNormal];
//    [self.sopInfo addTarget:self action:@selector(infoClick) forControlEvents:UIControlEventTouchUpInside];
    [self.okButton addTarget:self action:@selector(infoClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.notokButton addTarget:self action:@selector(infoClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.okButton setBackgroundColor:[UIColor lightGrayColor]];
    [self.notokButton setBackgroundColor:[UIColor lightGrayColor]];
    self.okButton.imageEdgeInsets = UIEdgeInsetsMake(10, (SCREEN_WIDTH- 10)/2, 10, (SCREEN_WIDTH- 10)/2);
}
-(void)infoClick:(UIButton*)sender
{
    sender.selected=!sender.selected;
    [self.okButton setImage:[UIImage imageNamed:@"icon_checkbox_selected"] forState:UIControlStateSelected];
//    self.okButton.imageEdgeInsets = UIEdgeInsetsMake(10, (SCREEN_WIDTH- 10)/2, 10, (SCREEN_WIDTH- 10)/2);
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
+ (ChangeShiftViewCell *)cellWithTableView:(UITableView *)tableView {
    static NSString *ID = @"ChangeShiftViewCellID";
    
    ChangeShiftViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (!cell) {
        cell = [[NSBundle mainBundle] loadNibNamed:@"ChangeShiftViewCell" owner:nil options:nil].lastObject;
        cell.backgroundColor=[UIColor whiteColor];
        
    }
    return cell;
}
@end
